import request from '@/utils/request'

// 文件上传
export const uploadFile = (params, data) => {
  return request({
    url: '/file/upload',
    method: 'post',
    params,
    data,
    config: {
      headers: {
        'Content-Type': 'application/octet-stream; charset=utf-8'
      }
    }
  })
}

//文件预览
export const previewFile = (params) => {
  return request({
    url: 'file/preview',
    method: 'post',
    params
  })
}

// 文件查询
export const queryFiles = (params) => {
  return request({
    url: '/file/list',
    method: 'get',
    params
  })
}

// 文件删除
export const delFile = (params) => {
  return request({
    url: '/file/del',
    method: 'post',
    params
  })
}
